package com.ruoyi.web.controller.system;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.page.RPage;
import com.ruoyi.system.domain.vo.WOrderOpearaGoodVO;
import com.ruoyi.system.domain.vo.WOrderOpearaVO;
import com.ruoyi.system.service.IWOrderOpearaGoodService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * 物品库存记录Controller
 * 
 * @author ruoyi
 * @date 2021-12-05
 */

@Api("物品操作记录")
@RestController
@RequestMapping("/system/orderGoodOpera")
public class WOrderOpearaGoodController extends BaseController
{
    @Autowired
    private IWOrderOpearaGoodService wOrderOpearaGoodService;

    
    
    /**
     * 查询物品库存记录列表
     */
    @ApiOperation("查询入库记录,传goodsId 查询某一个物料的")
    @GetMapping("/inlist")
    public RPage<WOrderOpearaGoodVO> inlist(WOrderOpearaGoodVO wOrderOpearaGood)
    {
    	wOrderOpearaGood.setType(1);
    	wOrderOpearaGood.setStatus(3);
        startPage();
        List<WOrderOpearaGoodVO> list = wOrderOpearaGoodService.selectWOrderOpearaGoodListNew(wOrderOpearaGood);
        return getRPageTable(list);
    }
    
    
    @ApiOperation("查询退回记录,传goodsId 查询某一个物料的")
    @GetMapping("/returnlist")
    public RPage<WOrderOpearaGoodVO> returnlist(WOrderOpearaGoodVO wOrderOpearaGood)
    {
    	wOrderOpearaGood.setType(3);
        startPage();
        List<WOrderOpearaGoodVO> list = wOrderOpearaGoodService.selectWOrderOpearaGoodListNew(wOrderOpearaGood);
        return getRPageTable(list);
    }
    
    
    
    

//    /**
//     * 导出物品库存记录列表
//     */
//    @PreAuthorize("@ss.hasPermi('system:good:export')")
//    @Log(title = "物品库存记录", businessType = BusinessType.EXPORT)
//    @GetMapping("/export")
//    public AjaxResult export(WOrderOpearaGood wOrderOpearaGood)
//    {
//        List<WOrderOpearaGood> list = wOrderOpearaGoodService.selectWOrderOpearaGoodList(wOrderOpearaGood);
//        ExcelUtil<WOrderOpearaGood> util = new ExcelUtil<WOrderOpearaGood>(WOrderOpearaGood.class);
//        return util.exportExcel(list, "物品库存记录数据");
//    }
//
//    /**
//     * 获取物品库存记录详细信息
//     */
//    @PreAuthorize("@ss.hasPermi('system:good:query')")
//    @GetMapping(value = "/{id}")
//    public AjaxResult getInfo(@PathVariable("id") Long id)
//    {
//        return AjaxResult.success(wOrderOpearaGoodService.selectWOrderOpearaGoodById(id));
//    }
//
//    /**
//     * 新增物品库存记录
//     */
//    @PreAuthorize("@ss.hasPermi('system:good:add')")
//    @Log(title = "物品库存记录", businessType = BusinessType.INSERT)
//    @PostMapping
//    public AjaxResult add(@RequestBody WOrderOpearaGood wOrderOpearaGood)
//    {
//        return toAjax(wOrderOpearaGoodService.insertWOrderOpearaGood(wOrderOpearaGood));
//    }
//
//    /**
//     * 修改物品库存记录
//     */
//    @PreAuthorize("@ss.hasPermi('system:good:edit')")
//    @Log(title = "物品库存记录", businessType = BusinessType.UPDATE)
//    @PutMapping
//    public AjaxResult edit(@RequestBody WOrderOpearaGood wOrderOpearaGood)
//    {
//        return toAjax(wOrderOpearaGoodService.updateWOrderOpearaGood(wOrderOpearaGood));
//    }
//
//    /**
//     * 删除物品库存记录
//     */
//    @PreAuthorize("@ss.hasPermi('system:good:remove')")
//    @Log(title = "物品库存记录", businessType = BusinessType.DELETE)
//	@DeleteMapping("/{ids}")
//    public AjaxResult remove(@PathVariable Long[] ids)
//    {
//        return toAjax(wOrderOpearaGoodService.deleteWOrderOpearaGoodByIds(ids));
//    }
}
